<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    document.write("<pre>");
    function Person(){

    }
    /*Person.constructor得到的Person类的构造函数如下：
        function Function() {
            [native code]
        }
    */
    document.writeln("Person.constructor："+Person.constructor);//Person类的构造函数
    document.writeln("Person："+Person);
    var p1 = new Person();
    document.writeln("p1.constructor："+p1.constructor);//”p1.constructor“是得到p1实例的构造函数
    //如何判断某个对象是不是某个类型，采用如下两种方式
    if(p1 instanceof Person){
        document.writeln("p1 is Person ok1");
    }
    if(p1.constructor==Person){
        document.writeln("p1 is Person ok2");
    }

    var num1=123;
    document.writeln("num1.constructor："+num1.constructor);

    var str1="abc";
    document.writeln("str1.constructor："+str1.constructor);
    document.write("</pre>")
</script>
</body>
</html>